home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / Chip Temmuz 2004.iso / program / antispam / POPFile / setup.exe / popfile.pl < prev    next >
Encoding:
Perl Script  |  2004-03-02  |  2.4 KB  |  76 lines

  1. #!/usr/bin/perl
  2. # ---------------------------------------------------------------------------------------------
  3. #
  4. # popfile.pl --- Message analyzer and sorter
  5. #
  6. # Acts as a server and client designed to sit between a real mail/news client and a real mail/
  7. # news server using POP3.  Inserts an extra header X-Text-Classification: into the header to
  8. # tell the client which category the message belongs in and much more...
  9. #
  10. # Copyright (c) 2001-2003 John Graham-Cumming
  11. #
  12. #   This file is part of POPFile
  13. #
  14. #   POPFile is free software; you can redistribute it and/or modify
  15. #   it under the terms of the GNU General Public License as published by
  16. #   the Free Software Foundation; either version 2 of the License, or
  17. #   (at your option) any later version.
  18. #
  19. #   POPFile is distributed in the hope that it will be useful,
  20. #   but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. #   GNU General Public License for more details.
  23. #
  24. #   You should have received a copy of the GNU General Public License
  25. #   along with POPFile; if not, write to the Free Software
  26. #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  27. #
  28. #   Modified by     Sam Schinke (sschinke@users.sourceforge.net)
  29. #
  30. # ---------------------------------------------------------------------------------------------
  31.  
  32. use strict;
  33. use locale;
  34.  
  35. use lib defined($ENV{POPFILE_ROOT})?$ENV{POPFILE_ROOT}:'./';   
  36.  
  37. use POPFile::Loader;
  38.  
  39. # POPFile is actually loaded by the POPFile::Loader object which does all
  40. # the work
  41.  
  42. my $POPFile = POPFile::Loader->new();
  43.  
  44. # Indicate that we should create output on STDOUT (the POPFile
  45. # load sequence) and initialize with the version
  46.  
  47. $POPFile->debug(1);
  48. $POPFile->CORE_loader_init();
  49.  
  50. # Redefine POPFile's signals
  51.  
  52. $POPFile->CORE_signals();
  53.  
  54. # Create the main objects that form the core of POPFile.  Consists of the configuration
  55. # modules, the classifier, the UI (currently HTML based), platform specific code,
  56. # and the POP3 proxy.  The link the components together, intialize them all, load
  57. # the configuration from disk, start the modules running
  58.  
  59. $POPFile->CORE_load();
  60. $POPFile->CORE_link_components();
  61. $POPFile->CORE_initialize();
  62. if ( $POPFile->CORE_config() ) {
  63.     $POPFile->CORE_start();
  64.  
  65.     # This is the main POPFile loop that services requests, it will exit only when we
  66.     # need to exit
  67.  
  68.     $POPFile->CORE_service();
  69.  
  70.     # Shutdown every POPFile module
  71.  
  72.     $POPFile->CORE_stop();
  73. }
  74.  
  75. # END
  76.